home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 1
/
Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso
/
FILES
/
DEV
/
A-B
/
2Window.cpt
/
2Window.c
next >
Wrap
C/C++ Source or Header
|
1989-09-03
|
928b
|
50 lines
#include <Global.h>
#define FIRSTID 1000
#define SECONDID 1001
short updates;
main()
{
void initialize(void);
WindowPtr firstWindow, secondWindow;
EventRecord theEvent;
Str255 str;
Rect showRect;
initialize();
firstWindow = GetNewWindow(FIRSTID, NULL, -1);
SetPort(firstWindow);
MoveTo(20, 20);
DrawString("\pUpdate Events:");
SetRect(&showRect,120, 10, 170, 20);
secondWindow = GetNewWindow(SECONDID, NULL, -1);
while (true) {
if (GetNextEvent(everyEvent, &theEvent));
if (theEvent.what == updateEvt) {
updates++;
BeginUpdate(theEvent.message);
EndUpdate(theEvent.message);
}
if (theEvent.what == keyDown)
break;
NumToString(updates, &str);
EraseRect(&showRect);
MoveTo(120, 20);
DrawString(str);
}
}
void initialize(void)
{
InitGraf(&thePort);
InitFonts();
InitWindows();
InitMenus();
TEInit();
InitDialogs(0L);
InitCursor();
FlushEvents( everyEvent, 0 );
}